package kines;

/**
 * <p>Title: CT</p>
 * <p>Description: Intranet Consorcio Terrenos</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: Consorcio Terrenos</p>
 * @author Jose Delgado
 * @version 1.0
 */

import java.util.Arrays;

public class Utils {
  private static Utils instance = null;
  /**
   * Spanish Month's Names
   */
  private String monthNames[] = {"ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DICIEMBRE"};
  private Utils( ){

  }
  /**
   * Gets utils singleton instance
   * @return
   */
  public static Utils getInstance(){
    if( instance == null )instance = new Utils();
    return instance;
  }
  /**
   * Gets Month in Spanish
   * @param month numeric month ( 0-11 ) where 0 is "ENERO" and 11 is "DICIEMBRE"
   * @return month in Spanish
   */
  public String getMonthSpanish( int month ){
    return monthNames[month];
  }

  public int getMonthNumber( String month ){
    return Arrays.asList(monthNames).indexOf(month);
  }
}